# G3ngine CMake build system
#  ./
#
# Indrek Sünter <IndrekSnt@hotmail.com>

cmake_minimum_required(VERSION 2.8)

project (G3)

option (G3_BUILD_STATIC "Build G3 static" ON)
option (G3_BUILD_DEBUG "Build G3 debug version" ON)
option (G3_USE_BUGLE "Use bugle for debugging" OFF)

# Include directory
include_directories (include)
# Build directory
link_directories(lib lib/GLee lib/zip)

if (G3_USE_BUGLE)
	set (G3_GL_LIB bugle)
else (G3_USE_BUGLE)
	set (G3_GL_LIB GL)
endif (G3_USE_BUGLE)

# We definitely need SDL
find_package (SDL REQUIRED)
# And 1075a 07h3rz
set (G3_LIBRARIES zip z lzo GLee SDL ${G3_GL_LIB} GLU jpeg png boost_signals-gcc42-mt-1_39 boost_thread-gcc42-mt-1_39 lua5.1 tolua++)

if (G3_BUILD_STATIC)
	set (G3_DEMO_LIBS G3 ${G3_LIBRARIES})
endif (G3_BUILD_STATIC)
if (NOT G3_BUILD_STATIC)
	set (G3_DEMO_LIBS G3)
endif (NOT G3_BUILD_STATIC)

# Debugging flagz
if (G3_BUILD_DEBUG)
	set (G3_DEBUG_FLAGS "-Wall -g")
endif (G3_BUILD_DEBUG)

# General flags
set (G3_FLAGS ${G3_DEBUG_FLAGS})
set (CMAKE_CXX_FLAGS ${G3_FLAGS})

add_subdirectory (src lib)
add_subdirectory (test test)

add_custom_target (docs doxygen Doxyfile COMMENT "Generating documentation")

